﻿using NewAI.Game;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NewAI.FSM.TankFSM
{
    public class TankWithdrawState : State<TankAI>
    {
        public override void Enter(TankAI entity)
        {
            entity.FightMethod = "撤退";
            Direction? movDir;
            BulletType bulletType;
            if (entity.DefaultWithdrawDirection.UseSuperBullet)
                bulletType = BulletType.Super;
            else
                bulletType = BulletType.Normal;
            movDir = entity.UseAstarGetCloseToAPoint(entity.NearliestTankInfo.Pos);
            if (movDir == null)
                movDir = entity.DefaultWithdrawDirection.Move;
            entity.SendActionObj(entity.DefaultWithdrawDirection.Fire, movDir,bulletType);
        }
    }
}
